<template>
    <div class="listbox">
        <ul class="inteInfo routerWapper" v-infinite-scroll="loadMores" infinite-scroll-disabled="loading" infinite-scroll-distance="10">
            <li class="list" v-for="(item,index) in bottomlist" :key="index" v-if="bottomlist.length!=0" @click="toNext('couponApplyDetail',{ applyNo: item.applyNo })">
                <div class="listcontent">
                    <div class="content">
                        <div class="cleft">
                            <div class="more">申请编号：{{item.applyNo}}</div>
                            <div class="more">申请日期：{{item.applyDateDes}}</div>
                            <div class="more" v-if="item.checkDateDes != ''">审核日期：{{item.checkDateDes}}</div>
                            <div class="more">审核状态：{{item.status | status}}</div>
                            <div class="big">
                                <p class="qiang">详情</p>
                            </div>
                        </div>
                    </div>
                </div>
            </li>
        </ul>
        <show-bg-img :isShow="showBg" title="暂无审核优惠券，去看看别的吧~~"></show-bg-img>
        <div class="cont"></div>
    </div>
</template>
<script>
import {
    getHomeBottomlist,
    queryCouponApplyList
} from "src/methods/request.js";
import mixins from 'mixins';
import { InfiniteScroll } from 'mint-ui';
export default {
    mixins:[mixins],
    data() {
        return {
            bottomlist: [],
            currentPage:1,
            loading:false,                  //滚动执行状态
        };
    },
    computed: {
        imgUrl() {
            return this.$store._modules.root._children.a.state;
        }
    },
    methods: {
        loadMores(){
            //获取底部热门商品
            this.$vux.loading.show({ text: "Loading" });
            queryCouponApplyList({currentPage: this.currentPage, perPage: 10}).then(res => {
                this.$vux.loading.hide();
                // this.bottomlist = Object.assign([], response.data.applyList);
                if (res.rspCode == "0000") {
                    this.bottomlist = this.bottomlist.concat(res.data.applyList);
                    this.totalGrowthValue = res.data.totalGrowthValue;
                    if (res.data.totalPage <= this.currentPage) {
                        this.loading = true;
                    } else {
                        this.currentPage += 1;
                    }
                } else {
                    Toast({ message: res.data.rspMsg,position: "middle",duration: 1000 });
                }
                this.showBg = this.bottomlist.length == 0;
            }).catch(error =>{
                this.$vux.loading.hide();
                this.showBg = this.bottomlist.length == 0;
            });
        }
    },
    created() {
        // this.loadMore();
    },
    filters: {
        status(value) {
            //发券途径
            return { "0": "已提交", "1": "已审核" }[value];
        }
    }
};
</script>
<style lang="less" scoped>
@import "./../../css/ckecked.css";
@import "./index.less";
</style>


